package com.hxkj.dao.impl;

import com.hxkj.dao.AuthFunctionDao;
import com.hxkj.domain.po.AuthFunction;
import com.hxkj.mapper.AuthFunctionMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-05-21 17:59:26
*
*/
@Service("authFunctionDao")
public class AuthFunctionDaoImpl implements AuthFunctionDao {

    @Resource
    private AuthFunctionMapper authFunctionMapper;

    @Override
    public AuthFunction get(Long functionId) {
        return authFunctionMapper.selectByPrimaryKey(functionId);
    }

    @Override
    public List<AuthFunction> get(AuthFunction authFunction) {
        return authFunctionMapper.select(authFunction);
    }

    @Override
    public int delete(Long functionId) {
        return authFunctionMapper.deleteByPrimaryKey(functionId);
    }

    @Override
    public int delete(AuthFunction authFunction) {
        return authFunctionMapper.delete(authFunction);
    }

    @Override
    public int deleteFunctionBySiteId(Long siteId) {
        return authFunctionMapper.deleteFunctionBySiteId(siteId);
    }

    @Override
    public int save(AuthFunction authFunction) {
        return authFunctionMapper.insert(authFunction);
    }

    @Override
    public int update(AuthFunction authFunction) {
        return authFunctionMapper.update(authFunction);
    }

    @Override
    public List<AuthFunction> getAssigned(Map<String,Object> map) {
        return authFunctionMapper.getAssigned(map);
    }

    @Override
    public void removeFunction(Long siteId) {
        authFunctionMapper.removeFunction(siteId);
    }

}
